import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizMilestoneManage = (params) => {
  params.head.transCode = 'queryBizMilestoneManage';
  return request({
    url: '/biz/bizMilestoneManage/queryBizMilestoneManage',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizMilestoneManageListPage = (params) => {
  params.head.transCode = 'queryBizMilestoneManageListPage';
  return request({
    url: '/biz/bizMilestoneManage/queryBizMilestoneManageListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizMilestoneManage = (params) => {
  params.head.transCode = 'saveBizMilestoneManage';
  return request({
    url: '/biz/bizMilestoneManage/saveBizMilestoneManage',
    method: 'post',
    data: params
  })
}
//增加基线快照
export const saveBaseline = (params) => {
  params.head.transCode = 'saveBaseline';
  return request({
    url: '/biz/bizMilestoneManage/saveBaseline',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizMilestoneManageList = (params) => {
  params.head.transCode = 'saveBizMilestoneManageList';
  return request({
    url: '/biz/bizMilestoneManage/saveBizMilestoneManageList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizMilestoneManage = (params) => {
  params.head.transCode = 'saveOrUpdateBizMilestoneManage';
  return request({
    url: '/biz/bizMilestoneManage/saveOrUpdateBizMilestoneManage',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizMilestoneManageList = (params) => {
  params.head.transCode = 'saveOrUpdateBizMilestoneManageList';
  return request({
    url: '/biz/bizMilestoneManage/saveOrUpdateBizMilestoneManageList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizMilestoneManage = (params) => {
  params.head.transCode = 'updateBizMilestoneManage';
  return request({
    url: '/biz/bizMilestoneManage/updateBizMilestoneManage',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizMilestoneManage = (params) => {
  params.head.transCode = 'deleteBizMilestoneManage';
  return request({
    url: '/biz/bizMilestoneManage/deleteBizMilestoneManage',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizMilestoneManageList = (params) => {
  params.head.transCode = 'deleteBizMilestoneManageList';
  return request({
    url: '/biz/bizMilestoneManage/deleteBizMilestoneManageList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizMilestoneManageExcel = (params) => {
  downloadExcel({
    url: '/biz/bizMilestoneManage/excelDownload/exportBizMilestoneManageExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
